//
//  KCHomeUserCell.m
//  Golden
//
//  Created by king on 2017/8/16.
//  Copyright © 2017年 KC. All rights reserved.
//

#import "KCHomeUserCell.h"

@interface KCHomeUserCell ()

@property (weak, nonatomic) IBOutlet UIImageView *goodView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *authorLabel;
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet UILabel *dateLabel;
@property (weak, nonatomic) IBOutlet UILabel *personLabel;

@end

@implementation KCHomeUserCell

- (void)setModel:(ploys *)model {
    
    _model = model;
    _nameLabel.text = _model.title;
    _authorLabel.text = _model.uname;
    _contentLabel.text = _model.articleTitle;
    _dateLabel.text = _model.articleUpdateTime;
    _personLabel.text = [NSString stringWithFormat:@"%@ 人订阅",_model.desertCount];
    
}

+ (instancetype)cellWithTableView:(UITableView *)tableview {
    
    KCHomeUserCell *cell = [tableview dequeueReusableCellWithIdentifier:NSStringFromClass(self)];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle]loadNibNamed:NSStringFromClass(self) owner:nil options:nil]lastObject];
    }
    return cell;
    
}


- (void)awakeFromNib {
    [super awakeFromNib];

    _goodView.contentMode = UIViewContentModeScaleAspectFill;
    _goodView.layer.cornerRadius = 10;
    _goodView.layer.masksToBounds = YES;
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
